package com.pai4j.netty.server.config.properties;


import com.pai4j.netty.server.common.PropertyLoader;
import lombok.Data;


/**
 * nacos.config.server-addr=127.0.0.1:8848
 * nacos.config.namespace=2cdfb8e3-f127-4020-93df-2d4c3dc805b5
 * nacos.config.group=DEFAULT_GROUP
 */
@Data
public class NacosConfig {

    private String serverAddr;
    private String namespace;
    private String group;

    public static NacosConfig init() {
        NacosConfig nacosConfig = new NacosConfig();
        nacosConfig.serverAddr = PropertyLoader.safeGetProperty("nacos.config.server-addr", String.class);
        nacosConfig.namespace = PropertyLoader.safeGetProperty("nacos.config.namespace", String.class);
        nacosConfig.group = PropertyLoader.safeGetProperty("nacos.config.group", String.class);
        return nacosConfig;
    }
}
